Skip to content

Harden agent publish, public STDF evidence, lints, fuzz, and decode throughput - #3

Merged
accuratep0wer merged 6 commits into
mainfrom
cursor/trust-ladder-gates-eeda
Nov 1, 2026
Merged

accuratep0wer merged 6 commits into
mainfrom
cursor/trust-ladder-gates-eeda

Conversation

@accuratep0wer

Copy link
Copy Markdown
Owner

Summary

Five reviewable commits for the top priorities in the Lauren Tan-derived improvement plan. The stale crates/ tree is untouched. Independent review is pending: this was one sequential agent, and the author is not an independent reviewer of the decoder change in commit 4.

  1. Stop hook no longer publishes. .cursor/hooks/auto-commit-push.ps1 writes a local patch under target/agent-work/checkpoints/ and does not git add, commit, or push. ZSTDF_AGENT_PUBLISH is ignored. scripts/publish_agent_branch.ps1 is the explicit coordinator path: it refuses main/master, runs fmt, clippy, and tests, and pushes only HEAD:refs/heads/agent/.... scripts/check_pr_size.py warns (does not fail) above 800 non-generated lines.
  2. Pinned public STDF counts are a CI assertion. examples/public-stdf/expected.json holds the decoder and viewer counts. The test checks SHA-256 from sources.json and skips unless the files exist or ZSTDF_REQUIRE_PUBLIC=1. Measured counts matched the README, including a595 latest 270 / unresolved 66.
  3. Workspace lints, toolchain pin, cargo-deny. unsafe_code is forbid, except stdf-io mmap and stdf-parquet FFI, which deny it and allow it only on those functions with SAFETY comments. unwrap_used and panic are denied outside tests. Production sites were turned into Result or a non-panicking exit. rust-toolchain.toml pins 1.99.1. deny.toml ignores advisories that parquet 55 / pyo3 0.24 cannot upgrade past; the reasons are in the file.
  4. Property tests and cargo-fuzz. stdf-core proptest covers a minimal FAR/PIR/PTR/PRR/DTR/MRR/unknown round trip, entry-point agreement, and prefix stability. fuzz/ has decode_all and truncate_prefix targets using the same oracles, seeded from the golden hex fixtures. A libFuzzer smoke found decode_all accepting a non-v4 FAR that decode_with_summary rejected. Both decode_all and summarize now use detect_byte_order_result.
  5. Decode-throughput experiment. Criterion benches the pinned files when they are downloaded, plus a synthetic file. scripts/bench_adapter.py prints {"records_per_sec": ...}. experiments/decode-throughput-01/contract.json protects tests, golden fixtures, expected.json, and the adapter. min_relative_gain is 0.30, above a 10-run max deviation of 0.141 and a later same-binary sample about 0.20 above that median.

Verification

  • python3 -m unittest scripts/test_check_pr_size.py — 6 passed. scripts/test_improvement_runner.py included in a 40-test run, passed.
  • PowerShell 7.4.6: hook on a temp repo wrote a checkpoint, left HEAD unchanged, and did not copy untracked bytes. publish_agent_branch.ps1 refused main, agent/../evil, and agent/Main before cargo.
  • Public files downloaded and checksums matched sources.json. cargo test -p stdf-cli pinned_public_files_match_expected_counts with ZSTDF_REQUIRE_PUBLIC=1 passed (about 107s).
  • cargo clippy --workspace --locked -- -D warnings passed after the lint fixes.
  • cargo deny --locked check (cargo-deny 0.20.2): advisories, bans, licenses, and sources ok. Duplicate-version warnings remain warnings.
  • cargo test --workspace --locked --exclude stdf-py with ZSTDF_REQUIRE_PUBLIC=1 passed, including after the FAR alignment (stdf-cli 189 tests).
  • cargo test -p stdf-core --test properties passed (round trip, arbitrary bytes, prefixes, golden fixtures).
  • libFuzzer, nightly 1.101.0, 15s each after the FAR fix: decode_all 5550 runs, truncate_prefix 1548 runs, both exit 0. The first smoke crashed on the FAR mismatch above; that input is fixed, not ignored.
  • Criterion --sample-size 10: synthetic plus lot2, lot3, and a595 completed.
  • scripts/bench_adapter.py printed one JSON object. improvement_runner.py init on the new contract returned ready.

Not run / follow-up

  • cargo test -p stdf-py does not link here. pyo3 is built with extension-module, so the test harness has no libpython. python3-dev was installed and the link line still omitted -lpython. This matches docs/development/multi-agent.md (cargo test --workspace --exclude stdf-py locally). CI still runs the full workspace test on Windows.
  • cargo fmt --all -- --check is not clean on rustfmt 1.10.0-stable (1.99.1). That was already true before this branch; this change did not reformat the tree. New and edited Rust files were formatted.
  • cargo clippy --all-targets -- -D warnings fails on pre-existing clippy::approx_constant in unit tests (3.14). Default CI clippy does not pass --all-targets.
  • expect_used and indexing_slicing were not enabled. CI uses -D warnings, so a warn-level lint would fail the build, and indexing_slicing would flag ordinary parser indexing.
  • The full improvement-runner evaluate loop was not executed. Only init and the noise samples were.
  • Local libFuzzer needed g++ and LIBRARY_PATH to libstdc++. GitHub's Ubuntu image usually has that toolchain; if the new fuzz job cannot find libstdc++, set the link path there.
  • Independent review of the decoder FAR change is pending.
Open in Web Open in Cursor 

cursoragent and others added 6 commits November 1, 2026 21:23
The stop hook no longer stages, commits, or pushes, so a session cannot
publish main or sweep untracked files. Coordinators publish only an
agent/ branch after format, Clippy, and tests, and CI warns on oversized diffs.

Co-authored-by: accuratep0wer <accuratep0wer@users.noreply.github.com>
expected.json records the decoder and viewer counts for the SHA-256 pinned
samples. The test checks those hashes and counts, and skips locally until
the files are downloaded.

Co-authored-by: accuratep0wer <accuratep0wer@users.noreply.github.com>
Workspace lints forbid unsafe except the mmap and FFI helpers, and deny
unwrap and panic outside tests. rust-toolchain.toml pins 1.99.1, and
cargo-deny runs in CI with explicit ignores for advisories blocked by
arrow/parquet 55.

Co-authored-by: accuratep0wer <accuratep0wer@users.noreply.github.com>
Proptest checks a minimal record round trip, entry-point agreement, and
prefix stability. cargo-fuzz targets use the same oracles. decode_all and
summarize now reject a non-v4 FAR the same way decode_with_summary does;
a libFuzzer smoke found that split.

Co-authored-by: accuratep0wer <accuratep0wer@users.noreply.github.com>
Criterion benches the pinned public samples, and bench_adapter.py emits
records_per_sec for the improvement runner. The gain threshold is 0.30,
above the spread measured on this host before the contract was frozen.

Co-authored-by: accuratep0wer <accuratep0wer@users.noreply.github.com>
The pinned toolchain's rustfmt check failed CI on viewer analysis
sources that were still wrapped for an older rustfmt.

Co-authored-by: accuratep0wer <accuratep0wer@users.noreply.github.com>
@accuratep0wer
accuratep0wer merged commit e66b5c7 into main Nov 1, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants